<template>
	<view class="box" @click="modalName=null">
		<view class="top tou" :style="'padding-top:' + statusBarHeight1 + 'px'">
			<view class="flex nav text-center">
				<view class="cu-item flex-sub" :class="0 == TabCur ? ' cur' : 'white'" @tap="tabSelect" :data-id="0">
					通知
				</view>
				<view class="cu-item flex-sub" :class="1 == TabCur ? ' cur' : 'white'" @tap="tabSelect" :data-id="1">
					私信
				</view>
				<!-- <view class="yd" @click.stop="yd"> 全部已读 </view> -->
			</view>
			<!-- #ifdef MP-WEIXIN -->
			<image class="index-sousou" style="width: 54rpx;height: 56rpx;left: 50rpx;" @click.stop="yd"
				src="https://pic.bangbangtongcheng.com/static/qbyd01.png" mode="widthFix" />
			<!-- #endif -->
			<!-- #ifndef MP-WEIXIN -->
			<image class="index-sousou" style="width: 54rpx;height: 56rpx;" @click.stop="yd"
				src="https://pic.bangbangtongcheng.com/static/qbyd01.png" mode="widthFix" />
			<!-- #endif -->
		</view>
		<view class="management" v-if="TabCur == 1">
			<view class="LH_management" @click="blockManagement">
				拉黑管理
			</view>
			<!-- <view class="LH_management" v-else></view> -->
			<!-- <view class="PL_management">
				<view class="PL_management_name" @click.stop="yd">全部已读</view>
			</view> -->
		</view>
		<scroll-view scroll-y="true" @click.stop="genduoChage=false" class="scroll-class">
			<view class="cu-list menu-avatar" v-if="0 == TabCur">
				<view class="cu-item news" :class="modalName == 'move-box-' + index ? 'move-cur' : ''"
					v-for="(item, index) in data1" :key="index" @touchstart="ListTouchStart" @touchmove="ListTouchMove"
					@touchend="ListTouchEnd" :data-target="'move-box-' + index" @click="notice(item)">
					<!-- <view style="margin-left: 20rpx;" v-if="width == 290">
						<checkbox :checked="item.active"
							:data-index="index" @click.stop="changeRadio"></checkbox>
					</view> -->
					<view class="tuP">
						<image class="image" src="https://pic.bangbangtongcheng.com/static/set.png"></image>
						<!-- 未读需要有红点 -->
						<view class="drop" v-if="item.is_read==2"></view>
					</view>
					<view class="N_center">
						<view class="notice_top">
							<view class="notice_left">系统通知</view>
							<view class="notice_right">{{$Time.getDateDiff(item.create_date)}}</view>
						</view>
						<view class="notice_center">
							{{ item.content }}
						</view>
					</view>
					<view class="move">
						<view class="bg-red" @click.stop="deletemessage(item.id)">删除</view>
					</view>
				</view>
				<view v-if="data1.length == 0" class="none">
					<image src="https://pic.bangbangtongcheng.com/static/none.png" mode="widthFix" />
					<view>没有更多数据了</view>
				</view>
			</view>
			<view class="cu-list menu-avatar" v-if="1 == TabCur">
				<view class="cu-item" :class="personalLetter == 'move-box-' + index ? 'move-cur' : ''"
					v-for="(item, index) in data" :key="index" @touchstart="personalListTouchStart"
					@touchmove="personalListTouchMove" @touchend="personalListTouchEnd"
					:data-target="'move-box-' + index"
					@click="chat(item.receiver,item.userName || item.nikeName,item.image||'https://pic.bangbangtongcheng.com/static/my/header.png'),item.isLh||0">
					<image class="cu-avatar round lg"
						:src="item.image ? item.image : 'https://pic.bangbangtongcheng.com/static/my/header.png'">
					</image>
					<view class="content" style="overflow: hidden;">
						<view class="text-grey">{{ item.nikeName ? item.nikeName : '未命名用户'}}</view>
						<view class="text-gray text-sm"
							style="min-height: 44rpx;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;">
							<!-- #ifdef MP-WEIXIN -->
							<rich-text :nodes="item.contentText"></rich-text>
							<!-- #endif -->
							<!-- #ifndef MP-WEIXIN -->
							<p v-html="item.contentText"></p>
							<!-- #endif -->
						</view>
					</view>
					<view class="action" style="width: 150rpx;">
						<view class="text-grey text-xs" v-if="item.chatRecord.chatRecord.length">
							{{ item.chatRecord.chatRecord[0].crhm }}
						</view>
						<view v-if="item.wdnum > 0" class="cu-tag round sm" style="background: red; color: #fff">
							{{ item.wdnum }}
						</view>
						<view v-else style="min-height: 44rpx">
							<image v-if="item.noDisturb==0" style="width: 50rpx;height: 40rpx;"
								src="https://pic.bangbangtongcheng.com/static/bbcz/jinyan01.png" mode=""></image>
						</view>
					</view>
					<view class="move">
						<view class="bg-red" @click.stop="del(item.sender, item.receiver)">删除</view>
					</view>
				</view>

				<view v-if="data.length == 0" class="none">
					<image src="https://pic.bangbangtongcheng.com/static/none.png" mode="widthFix" />
					<view>没有更多数据了</view>
				</view>
			</view>
		</scroll-view>
		<view class="bot" v-if="width == 290">
			<checkbox style="top: 34rpx; left: 30rpx; position: relative" :checked="checked" @click="allChecked">
			</checkbox>
			<span style="position: absolute; top: 40rpx; left: 90rpx">全选</span>
			<view class="bot_4" @click="xiajiao">取消收藏</view>
		</view>
		<!-- 房源经纪人审核 -->
		<view class="audit"
			style="width: 100%;height: 100%;position: fixed;background-color: rgba(19, 18, 18, 0.5);z-index: 100;top: 0;"
			@click.self="hideDiv" v-if="fabuZbc">
			<view class="fabuZbc">
				<view class="popup_title">认证审核</view>
				<view class="content">{{content}}</view>
				<view class="jjyy">拒绝原因:</view>
				<textarea type="text" :value="textContent" maxlength="-1" @input="textInput"
					placeholder="拒绝时请输入拒绝原因"></textarea>
				<view class="auditBut">
					<view class="but1" @click="submitFeedback(2)">拒绝</view>
					<view class="but" @click="submitFeedback(1)">通过</view>
				</view>
			</view>
		</view>
		<!-- 车源经纪人审核 -->
		<view class="audit"
			style="width: 100%;height: 100%;position: fixed;background-color: rgba(19, 18, 18, 0.5);z-index: 100;top: 0;"
			@click.self="czhideDiv" v-if="czfabuZbc">
			<view class="fabuZbc">
				<view class="popup_title">认证审核</view>
				<view class="content">{{content}}</view>
				<view class="jjyy">拒绝原因:</view>
				<textarea type="text" :value="cztextContent" maxlength="50" @input="cztextInput"
					placeholder="拒绝时请输入拒绝原因"></textarea>
				<view class="auditBut">
					<view class="but1" @click="czsubmitFeedback(2)">拒绝</view>
					<view class="but" @click="czsubmitFeedback(1)">通过</view>
				</view>
			</view>
		</view>
		<!-- 照片弹窗 -->
		<uni-popup ref="binds" mode="center" :mask-click="true">
			<!-- <view class="binds_frame">
				<view class="binds_frame_t">会员礼品赠送</view>
				<view class="binds_frame_c">您于{{collectData.lssuingTime}}在{{collectData.merchantName}}领取帮帮同城{{collectData.month}}月赠礼一份。</view>
				<view class="binds_frame_b">
					<view class="cancel" @click="jcbdCancel">查看详情</view>
					<view class="determine" @click="confirmReceipt">知道了</view>
				</view>
			</view> -->
			<view class="uni-popup-wrapper" style="padding: 0;">
				<text class="cuIcon-close close" @click="confirmReceipt"></text>
				<view class="uni-popup-title" style="line-height:45rpx;">
					会员礼品赠送
				</view>
				<view class="uni-popup-content" style="padding: 20rpx;font-size: 28rpx;color: #666666;">
					<view class="" style="">
						您于{{collectData.lssuingTime}}在{{collectData.merchantName}}领取帮帮同城{{collectData.month}}月赠礼
					</view>
				</view>
				<view class="uni-popup-seperate" style="margin: 0 22rpx;height: 0; border: 1rpx solid #D8D8D8;"></view>
				<view class="uni-popup-list">
					<view class="uni-popup-item" v-for="(item,index) in collectDataList" :key="index">
						<view class="uni-popup-item-name">{{item.giftName}}</view>
						<view class="uni-popup-item-num">X1</view>
					</view>
					<!-- <view class="uni-popup-item">
						<view class="uni-popup-item-name">玻璃水</view>
						<view class="uni-popup-item-num">X1</view>
					</view> -->
				</view>
				<view class="tips">
					您对商家的服务满意吗?
				</view>
				<view class="scoringList">
					<view class="scoringItem" @click="scoringChange(20)" :class="scoringIndex == 20?'active' : ''">
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringIcon1.png"
							mode="scaleToFill"
							v-if="scoringIndex != 20"
							class="icon"
						/>
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringActiveIcon1.png"
							mode="scaleToFill"
							v-if="scoringIndex == 20"
							class="icon"
						/>
						<view v-if="scoringIndex == -1 || scoringIndex == 20">很不满</view>
					</view>
					<view class="scoringItem" @click="scoringChange(40)" :class="scoringIndex == 40?'active' : ''">
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringIcon2.png"
							mode="scaleToFill"
							v-if="scoringIndex != 40"
							class="icon"
						/>
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringActiveIcon2.png"
							mode="scaleToFill"
							v-if="scoringIndex == 40"
							class="icon"
						/>
						<view v-if="scoringIndex == -1 || scoringIndex == 40">不满</view>
					</view>
					<view class="scoringItem" @click="scoringChange(60)" :class="scoringIndex == 60?'active' : ''">
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringIcon3.png"
							mode="scaleToFill"
							v-if="scoringIndex != 60"
							class="icon"
						/>
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringActiveIcon3.png"
							mode="scaleToFill"
							v-if="scoringIndex == 60"
							class="icon"
						/>
						<view v-if="scoringIndex == -1 || scoringIndex == 60">一般</view>
					</view>
					<view class="scoringItem" @click="scoringChange(80)" :class="scoringIndex == 80?'active' : ''">
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringIcon4.png"
							mode="scaleToFill"
							v-if="scoringIndex != 80"
							class="icon"
						/>
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringActiveIcon4.png"
							mode="scaleToFill"
							v-if="scoringIndex == 80"
							class="icon"
						/>
						<view v-if="scoringIndex == -1 || scoringIndex == 80">满意</view>
					</view>
					<view class="scoringItem" @click="scoringChange(100)" :class="scoringIndex == 100?'active' : ''">
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringIcon5.png"
							mode="scaleToFill"
							v-if="scoringIndex != 100"
							class="icon"
						/>
						<image
							src="https://pic.bangbangtongcheng.com/icon/scoringActiveIcon5.png"
							mode="scaleToFill"
							v-if="scoringIndex == 100"
							class="icon"
						/>
						<view v-if="scoringIndex == -1 || scoringIndex == 100">很满意</view>
					</view>
					
				</view>
				<view class="uni-popup-btn-wrapper">
					<button class="uni-popup-btn cu-btn left" @click="jcbdCancel">查看详情</button>
					<!-- <button class="uni-popup-btn cu-btn right" @click="confirmReceipt">知道了</button> -->
				</view>
			</view>
		</uni-popup>
		<uniBall v-show="showBall" ref="uniBall"></uniBall>
		<view-tabbar :selected="3" style="z-index: 999;" @changeRelease="changeRelease"></view-tabbar>
	</view>
</template>

<script>
	//#ifdef H5
	import wxshare from "../../utils/index.js";
	//#endif
	import {
		mapGetters
	} from "vuex";
	import Tabbar from "@/components/tabbar.vue";
	export default {
		components: {
			"view-tabbar": Tabbar,
		},
		computed: {
			...mapGetters(["statusBarHeight1", "userinfo"]),
		},
		data() {
			return {
        		showBall: !0, // Ball 展示状态 默认展示
				modalName: null,
				width: 366,
				text: "批量管理",
				userInfo: uni.getStorageSync("Pduser"),
				data: [],
				TabCur: 0,
				data1: [],
				Pduser: null,
				fabuZbc: false,
				textContent: '', // 输入备注
				auditTitle: '认证审核',
				content: '',
				auditData: {},
				hideLeft: 0,
				// 左滑出现的内容
				options: [{
					text: '删除',
					style: {
						backgroundColor: '#f00'
					}
				}],
				personalLetter: null,
				personalHideLeft: 0,
				genduoChage: false,
				czfabuZbc: false,
				cztextContent: "",
				czauditData: {},
				collectData: {},
				collectDataList: {},
				itemCollectData: '',
				scoringIndex: -1
			};
		},
		mounted() {

		},
		filters: {
			images(url) {
				let arr = url.split("");
				if (arr[0] == "/") {
					return this.imgUrl + url;
				} else {
					return url;
				}
			},
		},
		onLoad(options) {
			// this.fnc();
			uni.hideTabBar();
			/* #ifdef H5 */
			this.jinzhi();
			/* #endif */
		},
		onShow() {
			this.userInfo = uni.getStorageSync("Pduser");
			this.getchat();
			this.getnotice();
			this.$nextTick(() => {
				this.$refs.uniBall.getData()
			})
		},
		methods: {
			changeRelease(status){
				this.showBall = !status;
			},
			scoringChange(index) {
				let that = this
				if(this.scoringIndex != -1)return
				this.scoringIndex = index
				
				this.$myRequest.post('/api/mobile/vehicleOwner/scoreMerchant', {
					userId: this.userInfo.id,
					merchantId:this.collectData.merchantId,
					receiveId:this.collectData.batchCode,
					score:index,
				}).then((res) => {
					uni.showToast({
						title: '评价成功',
						icon: 'none',
						mask: true
					})
					setTimeout(() => {
						that.confirmReceipt()
					}, 1500);
				})
			},
			confirmReceipt() {
				let that = this
				this.$myRequest.post("/api/mobile/vehicleOwner/receiveGifts", {
					giftDistributionRecordId: this.collectData.id,
					distributors: this.collectData.merchantId,
					issued_by: this.collectData.lssuedBy,
					role_type: this.collectData.roleType,
					licensePlateNumber: this.collectData.licensePlateNumber,
					receiveBy: this.collectData.receiveBy,
					giftId: this.collectData.giftId,
				}).then((res) => {
					uni.showToast({
						title: res.msg,
						icon: "none",
						mask: true
					});
					that.$myRequest.post("/mob/chatrecord/readNotice", {
						id: this.itemCollectData.id
					}).then((res) => {
						if (res.code == 200) {
							that.getnotice();
							that.fnc()
						}
					});
					this.$refs.binds.close()
				});
			},
			shopSwitchClick() {
				if (this.text == "批量管理") {
					this.text = "退出管理"
					this.width = 290;
				} else {
					this.text = "批量管理"
					this.width = 366;
				}
				this.genduoChage = false
			},
			changeRadio(e) {
				let that = this;
				let index = e.currentTarget.dataset.index;
				that.data1[index].active = !that.data1[index].active;
			},
			genduoClick() {
				if (this.text == "批量管理") {
					this.genduoChage = !this.genduoChage
				} else {
					this.shopSwitchClick()
					this.data1.forEach(v => {
						v.active = false
					})
				}
			},
			jcbdCancel() {
				this.$refs.binds.close()
				uni.navigateTo({
					url: "/pages_owner/carMember/receiveDetail?index=" + this.scoringIndex
				})
			},
			// 跳转拉黑管理
			blockManagement() {
				uni.navigateTo({
					url: "/pages_owner/my/blockManagement"
				});
			},
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
				if (this.TabCur == 0) {
					this.getnotice();
				} else {
					this.getchat();
				}
			},
			jinzhi() {
				let _this = this;
				let param = window.location.href.split("#")[0];
				uni.request({
					method: "post",
					data: {
						url: param,
					},
					header: {
						"content-type": "application/x-www-form-urlencoded",
					},
					url: "https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do",
					success(re) {
						_this.jinzhifx(re.data);
					},
				});
			},
			jinzhifx(data) {
				wxshare.config({
					debug: false, //是否打开调试
					appId: data.appId, // 公众号的唯一标识
					timestamp: data.timestamp, // 生成签名的时间戳
					nonceStr: data.nonce, // ，生成签名的随机串
					signature: data.signature, // 签名
					jsApiList: ["hideMenuItems"],
				});
				// 禁止分享
				wxshare.hideMenuItems({
					// 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
					menuList: [
						"menuItem:share:appMessage",
						"menuItem:share:timeline",
						"menuItem:share:timeline",
						"menuItem:share:qq",
						"menuItem:favorite",
						"menuItem:share:QZone",
						"menuItem:openWithSafari",
					],
				});
			},
			// ListTouch触摸开始
			ListTouchStart(e) {
				console.log("3333")
				this.listTouchStart = e.touches[0].pageX;
			},
			personalListTouchStart(e) {
				this.listTouchStart = e.touches[0].pageX;
			},
			getnotice() {
				this.$myRequest
					.get("/mob/user/getExamineInfo", {
						userId: this.userInfo.id,
						pageNo: 1,
						pageSize: 999,
					})
					.then((res) => {
						res.page.result.forEach(v => {
							v.active = false
						})

						// res.page.result
						this.data1 = res.page.result;
					});
			},
			deletemessage(id) {
				let that = this;
				this.$myRequest
					.post("/mob/user/deleteExamineInfo", {
						id: id
					})
					.then((res) => {
						if (res.code == 200) {
							uni.showToast({
								title: "操作成功",
								icon: "none",
							});
							setTimeout(() => {
								that.getnotice();
							}, 500);
						}
					});
			},
			del(sender, receiver) {
				let that = this;
				this.$myRequest
					.post("/mob/chatrecord/removeUser", {
						receiver,
						sender,
					})
					.then((res) => {
						if (res.code == 200) {
							uni.showToast({
								title: "操作成功",
								icon: "none",
							});
							setTimeout(() => {
								that.getchat();
							}, 500);
						}
					});
			},
			formatDate(d) {
				var date = new Date(d);
				var YY = date.getFullYear() + '-';
				var MM =
					(date.getMonth() + 1 < 10 ?
						'0' + (date.getMonth() + 1) :
						date.getMonth() + 1) + '-';
				var DD = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
				var hh =
					(date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
				var mm =
					(date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) +
					':';
				var ss =
					date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
				return YY + MM + DD + ' ' + hh + mm + ss;
			},
			notice(item) {
				console.log(item);
				if (this.hideLeft == 1) {
					this.hideLeft = '0';
					return
				}
				let that = this
				if (item.type == "2" && item.examine_status == "0") {
					if (item.business_type == 1) {
						that.fabuZbc = true
						that.content = item.content
						const user = that.userInfo;
						that.auditData = {
							createBy: item.create_by,
							shopName: user.shopName,
							shopId: user.shopId,
							userId: item.create_by,
							id: item.id,
							createBy: item.create_by,
							examineStatus: 0,
							remark: "",
						};
					} else {
						that.czfabuZbc = true
						that.content = item.content
						const user = that.userInfo;
						that.czauditData = {
							reviewedBy: user.id,
							auditee: item.create_by,
							storeId: user.shopId,
							auditStatus: 0,
							businessType: user.businessType,
							systemMessagesId: item.id,
							refuseReason: "",
						};
					}
				} else if (item.type == "16") {
					if (item.is_read != 2) {
						return
					}
					this.itemCollectData = item
					var arr = JSON.parse(item.remark)
					this.collectDataList = arr
					this.collectData = arr[0]



					this.collectData.lssuingTime = this.formatDate(this.collectData.lssuingTime)
					this.scoringIndex = -1
					this.$refs.binds.open()
				} else if (item.type == 4 && item.is_read == 2) {
					uni.showModal({
						title: '系统消息',
						content: item.content,
						showCancel: false,
						success: function(res) {
							if (res.confirm) {
								if (that.userInfo.businessType == 1) {
									that.$myRequest
										.post('/mob/user/confirmResignation', {
										id: that.userInfo.id,
									})
								} else {
									that.$myRequest
										.post('/api/mobile/vehicleOwner/confirmResignation', {
										userId: that.userInfo.id,
									})
								}
								that.$myRequest.post("/mob/chatrecord/readNotice", {
									id: item.id
								}).then((res) => {
									if (res.code == 200) {
										that.getnotice();
										that.fnc()
									}
								});
							}

						}
					})
				} else if (item.type === '31') {
					uni.showModal({
						title: '系统消息',
						content: item.content,
						showCancel: false,
						// cancelText: '知道了',
						// confirmText: '去看看',
						success: function(res) {
							if (res.confirm) {
								that.$myRequest.post("/mob/chatrecord/readNotice", {
									id: item.id
								}).then((res) => {
									if (res.code == 200) {
										that.getnotice();
										that.fnc()
									}
								});
								if (item.remark) {
									uni.navigateTo({
										url: `/pages_recruitMoney/my/recruitmentManagementList?id=${item.remark}`,
									});
								}
							}

						}
					})
				} else {
					uni.showModal({
						title: '系统消息',
						content: item.content.includes("拒绝原因") ? item.content.replace("拒绝原因", '\n拒绝原因') : item
							.content,
						showCancel: false,
						success: function(res) {
							if (res.confirm) {
								that.$myRequest.post("/mob/chatrecord/readNotice", {
									id: item.id
								}).then((res) => {
									if (res.code == 200) {
										that.getnotice();
										that.fnc()
									}
								});
							}

						}
					})
				}
				console.log(item);
				// uni.navigateTo({
				//   url: `/pages/news/chat1?id=${id}`,
				// });
				// this.$myRequest
				//   .get("/mob/user/getMsgInfoDetail", {
				//     id,
				//   })
				//   .then((res) => {});
			},
			fnc() {
				// this.userInfo = uni.getStorageSync("Pduser");

				if (this.userInfo.id) {

					this.$myRequest
						.get("/mob/user/getIsReadMsg", {
							isRead: 2,
							examineStatus: 2,
							userId: this.userInfo.id
						})
						.then((res) => {
							console.log(res.result);
							this.$store.commit('user/SET_MESSAGENUM', res.result);

						});
				}
			},
			//获取输入的值
			textInput(e) {
				this.textContent = e.detail.value;
			},
			//获取输入的值
			cztextInput(e) {
				this.cztextContent = e.detail.value;
			},
			submitFeedback(type) {

				if (type == 2) { //拒绝
					if (!this.textContent) {
						uni.showToast({
							title: "请填写拒绝原因",
							icon: "none",
							mask: true
						});
						return
					}
					this.auditData.remark = this.textContent;
					this.auditData.examineStatus = 2;
				}
				if (type == 1) { //同意
					delete this.auditData.remark;
					this.auditData.examineStatus = 1;
				}
				this.$myRequest.post("mob/user/merchantAudit", this.auditData).then((res) => {
					if (res.code == 200) {
						uni.showToast({
							title: "操作成功",
							icon: "success",
						});
						this.getnotice();
						this.auditData = {}
						this.content = "";
						this.textContent = "";
						this.fabuZbc = false;
					}
				});
			},
			czsubmitFeedback(type) {

				if (type == 2) { //拒绝
					if (!this.cztextContent) {
						uni.showToast({
							title: "请填写拒绝原因",
							icon: "none",
							mask: true
						});
						return
					}
					this.czauditData.refuseReason = this.cztextContent;
					this.czauditData.auditStatus = 2;
				}
				if (type == 1) { //同意
					delete this.czauditData.refuseReason;
					this.czauditData.auditStatus = 1;
				}
				this.$myRequest.post("/api/mobile/vehicleOwner/salesConsultantReview", this.czauditData).then((res) => {
					if (res.code == 200) {
						uni.showToast({
							title: "操作成功",
							icon: "success",
						});
						this.getnotice();
						this.czauditData = {}
						this.content = "";
						this.cztextContent = "";
						this.czfabuZbc = false;
					}
				});
			},
			// 隐藏输入弹出框
			hideDiv() {
				this.fabuZbc = false
			},
			// 隐藏输入弹出框
			czhideDiv() {
				this.czfabuZbc = false
			},
			yd() {
				this.$myRequest
					.post("/mob/chatrecord/readChatAll", {
						receiver: this.userInfo.id,
					})
					.then((res) => {
						if (res.code == 200) {
							uni.showToast({
								title: "操作成功",
								icon: "none",
								mask: true,
							});
							this.genduoChage = false
							this.data.forEach((el) => {
								el.wdnum = 0;
							});

							this.getchat();
							this.getnotice();
							this.fnc()
						}
					});
			},
			getchat() {
				console.log(this.userInfo, 11111111111);
				this.$myRequest
					.get("/mob/chatrecord/getChatUser", {
						userId: this.userInfo.id,
					})
					.then((res) => {
						console.log(res);
						for (var i = 0; i < res.data.list.length; i++) {
							if (res.data.list[i].chatRecord.chatRecord.length > 0) {
								if (
									res.data.list[i].chatRecord.chatRecord[0].content.search(
										"sendIamge"
									) != -1
								) {
									res.data.list[i].contentText = "[图片]";
								} else if (res.data.list[i].chatRecord.chatRecord[0].content.search(
										"characteristicData"
									) != -1) {
									if (res.data.list[i].chatRecord.chatRecord[0].content.characteristicData == 1) {
										res.data.list[i].contentText = "[房源]";
									} else if (res.data.list[i].chatRecord.chatRecord[0].content.characteristicData ==
										2) {
										res.data.list[i].contentText = "[车源]";
									} else if (res.data.list[i].chatRecord.chatRecord[0].content.characteristicData ==
										3) {
										res.data.list[i].contentText = "[服务项目]";
									}
								} else {
									res.data.list[i].contentText =
										res.data.list[i].chatRecord.chatRecord[0].content;
								}
							} else {
								res.data.list[i].contentText = "";
							}
						}
						// this.data = res.data.list.concat(res.data.list)
						// 排序
						console.log(res.data.list)
						// res.data.list.sort(function(a,b){

						// })
						this.data = res.data.list;
					});
			},
			// ListTouch计算方向
			ListTouchMove(e) {
				console.log("222")
				this.listTouchDirection =
					e.touches[0].pageX - this.listTouchStart > 0 ? "right" : "left";
			},

			// ListTouch计算滚动
			ListTouchEnd(e) {
				console.log("111")
				if (this.listTouchDirection == "left") {
					this.hideLeft = '1'
					this.modalName = e.currentTarget.dataset.target;
				} else {
					this.modalName = null;
				}
				this.listTouchDirection = null;
			},
			personalListTouchMove(e) {
				this.listTouchDirection =
					e.touches[0].pageX - this.listTouchStart > 0 ? "right" : "left";
			},

			// ListTouch计算滚动
			personalListTouchEnd(e) {
				console.log('1111')
				if (this.listTouchDirection == "left") {
					this.personalHideLeft = '1'
					this.personalLetter = e.currentTarget.dataset.target;
				} else {
					this.personalLetter = null;
				}
				this.listTouchDirection = null;
			},
			chat(receiver, nikeName, img, isLh) {
				if (this.personalHideLeft == 1) {
					this.personalHideLeft = '0';
					return
				}
				uni.navigateTo({
					url: `/pages/news/chat1?receiver=${receiver}&img=${img}&nikeName=${nikeName}&isLh=${isLh}`,
				});
			},
		},
	};
</script>
<style lang="less" scoped>
	.scroll-class {
		/* #ifdef MP  */
		height: calc(100vh - 88rpx - 88rpx - 100rpx - env(safe-area-inset-bottom) / 2);
		/* #endif */
		/* #ifdef H5 || APP-PULS */
		height: calc(100vh - var(--status-bar-height) - 88rpx - 10rpx - 100rpx - env(safe-area-inset-bottom) / 2);
		/* #endif */
		/* #ifdef APP */
		height: calc(100vh - var(--status-bar-height) - 88rpx - 10rpx - 100rpx - env(safe-area-inset-bottom) / 2);
		/* #endif */
	}

	.tou {
		position: relative;

		.index-sousou {
			bottom: 16rpx !important;
		}

		image {
			position: absolute;
			width: 56rpx;
			height: 56rpx;
			bottom: 16rpx !important;
			/* #ifdef H5 || APP */
			right: 30rpx;
			/* #endif */
			/* #ifdef MP-WEIXIN */
			transform: translateX(-50%);
			left: 30rpx;
			/* #endif */
		}
	}

	// 系统通知的css
	.news {
		.tuP {
			width: 90rpx;
			height: 90rpx;
			margin-left: 20rpx;
			position: relative;
			margin-right: 30rpx;

			.image {
				width: 100%;
				height: 100%;
			}

			.drop {
				position: absolute;
				top: -10rpx;
				right: 0;
				width: 18rpx;
				height: 18rpx;
				border-radius: 18rpx;
				background-color: #DB2C2C;
			}
		}

		.N_center {
			flex: 1;
			margin-right: 20rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;

			.notice_top {
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.notice_left {
					font-size: 28rpx;
					font-weight: 500;
					color: #333333;
				}

				.notice_right {
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
				}
			}

			.notice_center {
				width: 100%;
				font-size: 26rpx;
				font-weight: 400;
				color: #999999;
				overflow: hidden;
				word-break: break-all;
				line-break: anywhere;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2; //想要的行数
				-webkit-box-orient: vertical;
			}
		}
	}

	.bot {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 120rpx;
		background-color: #fff;
		z-index: 9;

		view {
			display: inline-block;
			position: absolute;
		}

		.bot_1 {
			left: 42rpx;
			top: 38rpx;
		}

		.bot_4 {
			width: 200rpx;
			height: 70rpx;
			background: #64b6a8;
			color: #ffffff;
			line-height: 68rpx;
			left: 520rpx;
			top: 25rpx;
			text-align: center;
			border-radius: 36rpx;
		}
	}

	.management {
		height: 100rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin: 0 40rpx;

		.LH_management {
			font-size: 30rpx;
			font-weight: 400;
			color: #64B6A8;
			border-bottom: 1px solid #64B6A8;
		}

		.PL_management {
			position: relative;

			.PL_management_name {
				font-size: 30rpx;
				font-weight: 400;
				color: #64B6A8;
				border-bottom: 1px solid #64B6A8;
			}

			.administrations {
				width: 180rpx;
				height: 90rpx;
				background-color: #fff;
				position: absolute;
				right: 0rpx;
				bottom: -110rpx;
				box-shadow: 0px 0px 20px 1px #D0D0D0;
				z-index: 100;
				padding: 0 32rpx;
				display: flex;
				flex-direction: column;

				.items {
					height: 94rpx;
					color: #5A5E66;
					font-size: 28rpx;
					border-bottom: 1px solid #E0E0E0;
					display: flex;
					align-items: center;
					justify-content: center;
				}

				&::before {
					content: '';
					display: inline-block;
					border-left: 24rpx solid transparent;
					border-right: 20rpx solid transparent;
					border-bottom: 24rpx solid #fff;
					position: absolute;
					right: 12rpx;
					top: -22rpx;
				}
			}
		}
	}

	/deep/uni-checkbox .uni-checkbox-input {
		background-color: rgba(0, 0, 0, 0);
		border: 2rpx solid #999;
	}

	/deep/uni-checkbox .wx-checkbox-input,
	/deep/uni-checkbox .uni-checkbox-input {
		width: 48rpx;
		height: 48rpx;
	}

	/deep/.uni-checkbox-input-checked {
		background-color: #64b6a8 !important;
		border: 2rpx solid #64b6a8 !important;
	}

	/deep/ uni-checkbox::before {
		font-size: 40rpx;
		margin-top: -14rpx;
		right: 6rpx !important;
	}

	.box {
		min-height: 100vh;
		background: #fff;
	}

	.nav {
		width: 400rpx;
		margin: 0 auto;
		position: relative;

		.tzts {
			color: red;
			position: fixed;
			top: 0;
			left: 170px;
			font-weight: bold;
			font-size: 18px;
		}

		.xxts {
			position: fixed;
			left: 270px;
			color: red;
			top: 0;
			font-weight: bold;
			font-size: 18px;
		}
	}

	.white {
		color: white;
	}

	.cur {
		font-size: 36rpx;
		font-weight: bold;
		color: white;
	}

	.yd {
		font-size: 24rpx;
		position: absolute;
		padding: 0 11rpx;
		height: 42rpx;
		line-height: 42rpx;
		border: 1rpx solid #fff;
		top: 50%;
		transform: translateY(-50%);

		// #ifdef MP-WEIXIN
		left: -140rpx;
		// #endif
		// #ifndef MP-WEIXIN
		right: -100rpx;
		// #endif
		color: #fff;
		border-radius: 100rpx;
	}

	.aa {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.down {
		height: 60rpx;
		line-height: 60rpx;
		// border-top: 2rpx solid #d0d0d0;
		text-align: center;
	}

	.none {
		text-align: center;

		image {
			width: 430rpx;
			margin-bottom: 16rpx;
		}

		view {
			height: 40rpx;
			line-height: 40rpx;
			color: #666;
		}
	}

	.menu-avatar {
		padding-bottom: 80px;
	}

	.fabuZbc {
		position: fixed;
		top: 20%;
		left: 50%;
		transform: translateX(-50%);
		width: 300px;
		background-color: #f3efef;

		.popup_title {
			line-height: 40px;
			text-align: center;
			height: 40px;
			background-color: #64b6a8;
			color: #fff;
			font-size: 16px;
		}

		.content {
			margin-left: 10px;
			margin-right: 10px;
			text-align: left;
			margin-top: 10px;
			font-size: 16px;
		}

		.jjyy {
			margin-top: 10px;
			font-size: 16px;
			margin-left: 10px;
		}

		textarea {
			margin-top: 10px;
			color: rgb(97, 94, 94);
			margin-left: 10px;
			height: 50px;
		}

		.auditBut {
			display: flex;
			justify-content: center;
			margin-bottom: 40rpx;

			.but {
				width: 200rpx;
				height: 80rpx;
				background: #64b6a8;
				border-radius: 50rpx;
				font-size: 34rpx;
				text-align: center;
				line-height: 80rpx;
				color: #fff;
				margin-top: 24rpx;
				margin-left: 40rpx;
			}

			.but1 {
				width: 200rpx;
				height: 80rpx;
				background: #7c7c7c;
				border-radius: 50rpx;
				font-size: 34rpx;
				text-align: center;
				line-height: 80rpx;
				color: #fff;
				margin-top: 24rpx;
			}
		}
	}

	.binds_frame {
		width: 600rpx;
		background-color: #FFFFFF;
		padding-bottom: 50rpx;
		border-radius: 10rpx;
		text-align: center;

		.binds_frame_t {
			font-size: 30rpx;
			font-weight: 550;
			color: #000000;
			padding: 0 46rpx;
			padding-top: 36rpx;
		}

		.binds_frame_c {
			width: 500rpx;
			margin: 0 auto;
			font-size: 28rpx;
			font-weight: 400;
			color: #64B6A8;
			margin-top: 30rpx;
			margin-bottom: 50rpx;
		}

		.binds_frame_b {
			display: flex;
			align-items: center;
			justify-content: space-around;

			.cancel {
				width: 210rpx;
				height: 70rpx;
				background-color: #64B6A8;
				border-radius: 10rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 30rpx;
				font-weight: 400;
				color: #fff;
			}

			.determine {
				width: 210rpx;
				height: 70rpx;
				background-color: #000;
				border-radius: 10rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 30rpx;
				font-weight: 400;
				color: #fff;
			}
		}
	}

	
	.uni-popup-wrapper {
		width: 600rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		opacity: 1;
		padding: 0 32rpx;
		text-align: center;
		overflow: hidden;
		position: relative;
		.close {
			position: absolute;
			top: 30rpx;
			right: 30rpx;
			color: #333;
			font-size: 40rpx;
		}
		.tips{
			color: #666666;
			font-size: 28rpx;
			line-height: 39rpx;
			text-align: center;
			margin-bottom: 48rpx;
		}
		.scoringList{
			display: flex;
			justify-content: space-between;
			padding: 0 32rpx;
			margin-bottom: 58rpx;
			.scoringItem{
				text-align: center;
				.icon {
					width: 80rpx;
					height: 80rpx;
					margin-bottom: 8rpx;
				}
				view {
					color: #999999;
					font-size: 26rpx;
					line-height: 36rpx;
				}
				&.active {
					view {
						color: #222;
					}
				}
			}
		}
	}

	.uni-popup-title {
		margin-top: 32rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
		line-height: 30rpx;
	}

	.uni-popup-content {
		padding: 30rpx 32rpx 40rpx 32rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
		line-height: 42rpx;

	}

	.uni-popup-btn-one {
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		background: #64B6A8;
		border-radius: 40rpx 40rpx 40rpx 40rpx;
		opacity: 1;
		font-size: 30rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 30rpx;
		margin-bottom: 32rpx;
	}

	.uni-popup-mark {
		color: #E00000;
	}

	.uni-popup-tip {
		font-size: 20rpx;
		font-weight: 400;
		color: #999999;
		line-height: 28rpx;
		margin: 10rpx auto;
	}

	.uni-popup-btn-wrapper {
		display: flex;
		width: 100%;
		justify-content: center;
		padding-bottom: 48rpx;
	}

	.uni-popup-btn {
		width: 504rpx;
		// flex: 1;
		height: 90rpx;
		line-height: 90rpx;
		font-size: 30rpx;
		font-weight: 400;
		opacity: 1;
		border-radius: 500rpx;

		&.left {
			background: #64B6A8;
			color: #FFFFFF;
		}

		&.right {
			background: #64B6A8;
			color: #FFFFFF;
		}
	}

	.uni-popup-list {
		margin: 0 22rpx 32rpx 22rpx;

		.uni-popup-item {
			margin-top: 20rpx;

			font-size: 28rpx;
			font-weight: 400;
			color: #333333;
			line-height: 39rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			.uni-popup-item-name {
				text-align: left;
				width: 500rpx;
			}
		}
	}
</style>